package cn.proandcus;

/**
 * 生产者
 */
public class Producer implements Runnable{
    private Box box;

    public Producer(Box box){
        this.box=box;
    }
    @Override
    public void run() {
       for (int i=1;i<=10000;i++){
           try {
               box.setMilk(i);//生产者生产牛奶

           } catch (InterruptedException e) {
               e.printStackTrace();
           }
       }
    }
}
